package com.sino.servlet;

import java.util.Map;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import com.sino.business.service.LoginInfo;
import com.sino.model.ExpertModel;

public class AdminInterceptor extends AbstractInterceptor  {
	
	
	public String intercept(ActionInvocation arg0) throws Exception {
	Map session = arg0.getInvocationContext().getSession();
	LoginInfo logininfo = (LoginInfo)session.get("logininfo");
	ExpertModel expertModel=(ExpertModel)session.get("expertModel");
	if(logininfo==null&&expertModel==null){
		return Action.LOGIN;
	}else{
		return arg0.invoke();
	}
	}
}
